package com.xbongbong.saas.model.impl;

import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.saas.domain.dao.PurchaseInvoiceRelationshipDao;
import com.xbongbong.saas.domain.entity.PurchaseInvoiceRelationshipEntity;
import com.xbongbong.saas.model.PurchaseInvoiceRelationshipModel;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


/**
 * @author yuqian
 * @version v1.0
 * @date 2020/2/24 15:30
 * @since v1.0
 */
@Service("PurchaseRelationshipModel")
public class PurchaseInvoiceRelationshipModelImpl implements PurchaseInvoiceRelationshipModel {

    @Resource
    private PurchaseInvoiceRelationshipDao dao;

    @Override
    public Integer insert(PurchaseInvoiceRelationshipEntity entity) throws XbbException {
        return dao.insert(entity);
    }

    @Override
    public Integer update(PurchaseInvoiceRelationshipEntity entity) throws XbbException {
        return dao.update(entity);
    }

    @Override
    public List<PurchaseInvoiceRelationshipEntity> findEntitys(Map<String, Object> param) {
        return dao.findEntitys(param);
    }

    @Override
    public Integer getEntitysCount(Map<String, Object> param) {
        return dao.getEntitysCount(param);
    }

    @Override
    public List findEntitysWithoutSub(Map<String, Object> param) {
        return null;
    }

    @Override
    public void batchInsert(List<PurchaseInvoiceRelationshipEntity> list) {
        dao.batchInsert(list);
    }

    @Override
    public PurchaseInvoiceRelationshipEntity getByKey(Long key, String corpid) {
        return dao.getByKey(key,corpid);
    }

    @Override
    public List<Map<String, Object>> getSumMoneyOfPurchase(Map<String, Object> param) {
        return dao.getSumMoneyOfPurchase(param);
    }

    @Override
    public List<Map<String, Object>> getSumMoneyOfPayPlan(Map<String, Object> param) {
        return dao.getSumMoneyOfPayPlan(param);
    }

    @Override
    public List<Map<String, Object>> getSumMoneyOfPaySheet(Map<String, Object> param) {
        return dao.getSumMoneyOfPaySheet(param);
    }

    @Override
    public Integer deleteByInvoiceId(Long purchaseInvoiceId, String corpid) {
        return dao.deleteByInvoiceId(purchaseInvoiceId, corpid);
    }

    @Override
    public Integer deleteByInvoiceIdIn(List<Long> purchaseInvoiceIdIn, String corpid) {
        return dao.deleteByInvoiceIdIn(purchaseInvoiceIdIn,corpid);
    }

    @Override
    public void updateIsCancel(Integer isCancel, Map<String, Object> param) {
        dao.updateIsCancel(isCancel, param);
    }

    @Override
    public void updateApprove(Integer approveStatus,Map<String, Object> param){
        dao.updateApprove(approveStatus,param);
    }

    @Override
    public void updateBatchMoney(String corpid, List<PurchaseInvoiceRelationshipEntity> list) {
        dao.updateBatchMoney(corpid, list);
    }
}
